//
//  LPWebWatchResouceViewController.m
//  ShangHaiHuDongApp
//
//  Created by 刘应平 on 2017/7/3.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "LPWebWatchResouceViewController.h"

@interface LPWebWatchResouceViewController ()<UIWebViewDelegate>
/**    */
@property (strong, nonatomic) UIWebView  *webView;

@end

@implementation LPWebWatchResouceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titlelabel.text = self.headLine;
    [YJProgressHUD showMessage:@"加载中" duration:10 view:self.view];
//    NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",DOWNFILE,self.urlString]];
    NSURL *url = [NSURL fileURLWithPath:self.urlString];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
    [self.view addSubview:self.webView];
    
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [YJProgressHUD hide];
}

#pragma mark -> 懒加载
- (UIWebView *)webView {
    if (!_webView) {
        _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, LP_TopHeight, self.view.width, self.view.height - LP_TopHeight)];
        _webView.delegate = self;
       _webView.scalesPageToFit = YES;
    }
    return _webView;
}


@end
